unit CadastroFabricante;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, UFomCadastro, DB, DBClient, Provider, DBTables, Menus, StdCtrls,
  ComCtrls, DBCtrls, Buttons, Grids, DBGrids, ExtCtrls, Mask;

type
  TFCadastroFabricante = class(TFormCadastro)
    cdsCadastroFABRI_CODIGO: TIntegerField;
    cdsCadastroFABRI_DESCRICAO: TStringField;
    cdsCadastroCODIGOEMPRESA: TIntegerField;
    cdsCadastroUSUARIO_CADASTRO: TStringField;
    cdsCadastroUSUARIO_AUTERACAO: TStringField;
    cdsCadastroUSUARIO_EXCLUSAO: TStringField;
    cdsCadastroDATA_CADASTRO: TDateTimeField;
    cdsCadastroDATA_EXCLUSAO: TDateTimeField;
    cdsCadastroDATA_AUTERACAO: TDateTimeField;
    cdsCadastroEXCLUIDO: TStringField;
    edCodigo: TDBEdit;
    edDescricao: TDBEdit;
    Label1: TLabel;
    Label2: TLabel;
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure BtnIncluirClick(Sender: TObject);
    procedure BtnEditarClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  FCadastroFabricante: TFCadastroFabricante;

implementation

uses UGeral;

{$R *.dfm}

procedure TFCadastroFabricante.FormClose(Sender: TObject;
  var Action: TCloseAction);
begin
  inherited;
  FCadastroFabricante.Release;
  FCadastroFabricante := Nil;
end;

procedure TFCadastroFabricante.BtnIncluirClick(Sender: TObject);
begin
  inherited;

  edCodigo.Field.AsInteger := Retorna_Codigo_Generetor('GEN_FABRICANTE');
  edDescricao.SetFocus;

end;

procedure TFCadastroFabricante.BtnEditarClick(Sender: TObject);
begin
  inherited;
  edCodigo.SetFocus;
end;

end.
